package com.itmuch.cloud;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.itmuch.cloud.user.User;
import feign.hystrix.FallbackFactory;


@Component
public class HystrixClientFactory implements FallbackFactory<UsedrFeignClient>{
	
	private static final Logger loger=LoggerFactory.getLogger(HystrixClientFactory.class);
	
	@Override
	public UsedrFeignClient create(Throwable arg0) {
		//HystrixClientFactory.loger.info(arg0.getMessage());
		return new UserFeignClientWithFactory() {
			
			@Override
			public User findById(Long id) {
				User user = new User();
				user.setId(-1l);
				return user;
			}
		};
	}
	
	
	
}
